package com.skit.main.viewmodels

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import com.skit.common.base.BaseViewModel
import com.skit.common.bean.ActivityBean
import com.skit.common.http.NetResult
import com.skit.main.data.HomeActivityRepository
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class ActivityViewModel @Inject constructor(private val repository: HomeActivityRepository) :
    BaseViewModel() {

    private val _activityLiveData: MutableLiveData<NetResult<List<ActivityBean>>> =
        MutableLiveData()
    val activityLiveData: LiveData<NetResult<List<ActivityBean>>> = _activityLiveData

    fun getUserCollectActivityList(refresh: Boolean, uid: Int) {
        netResult({
            repository.getUserCollectActivityList(refresh,uid)
        }) {
            _activityLiveData.value = it
        }
    }

}